package core;

import java.io.Serializable;

/**
 * Represents a data record in the song database.
 * Each record has an ID, descriptor fields, and data.
 * 
 * @author john
 *
 */
public abstract class Record implements Serializable {
	
	private static final long serialVersionUID = 2247516779782299531L;
	private int id;
	
	/**
	 * Creates a new data record.
	 * @param id	ID number of the record
	 */
	public Record(int id) {
		this.id = id;
	}
	
	/**
	 * Gets the ID number.
	 * @return	ID number of the record
	 */
	public int getId() {
		return id;
	}
	
	/**
	 * 
	 * @param i		index of the descriptor field
	 * @return		descriptor field contents
	 */
	public abstract Object getField(int i);
	
	/**
	 * 
	 * @param i		index of the descriptor field
	 * @param s		new descriptor field contents
	 */
	public abstract void setField(int i, Object s);
}
